package org.wmq.taskschedule.factory;

import org.springframework.beans.BeanUtils;
import org.wmq.taskschedule.algorithm.AlgorithmExecutor;
import org.wmq.taskschedule.algorithm.ImageSharpeningExecutor;
import org.wmq.taskschedule.biz.model.DO.Param;

/**
 * 图像锐化算法执行器工厂类
 * 实现AlgorithmExecutorFactory接口，用于创建ImageSharpeningExecutor实例
 */
public class ImageSharpeningExecutorFactory implements AlgorithmExecutorFactory {
    private static final ImageSharpeningExecutorFactory instance = new ImageSharpeningExecutorFactory();

    private ImageSharpeningExecutorFactory() {}
    
    /**
     * 获取工厂实例
     * @return ImageSharpeningExecutorFactory实例
     */
    public static ImageSharpeningExecutorFactory getInstance() {
        return instance;
    }
    
    @Override
    public AlgorithmExecutor getAlgorithmExecutor(Param param) {
        ImageSharpeningExecutor imageSharpeningExecutor = new ImageSharpeningExecutor();
        BeanUtils.copyProperties(param, imageSharpeningExecutor);
        return imageSharpeningExecutor;
    }
}